/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"2BD00638-7FCC-495F-9F8C-E1846CC9828B"}
 */
function cerrar(event) {
	oc_estado = 6
	filtrar()
}

/**
 * @properties={typeid:24,uuid:"46A8BA14-A91E-4E6F-B2C5-5D8DE2CBCA74"}
 * @AllowToRunInFind
 */
function filtrar()
{
	controller.find()
	
	oc_estado = 3
	controller.newRecord()
	oc_estado = 4
	
	controller.search()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"6A4139B3-3B33-4507-84DB-C311DDA6F627"}
 */
function iraDtl(event) {
	forms.oc_cabecera_dtl_dlg_ind.controller.loadRecords(oc_cabecera_id)
	var $win = application.createWindow('OC',JSWindow.MODAL_DIALOG)
	$win.title = 'Orden de Compra Nº '+forms.oc_cabecera_dtl_dlg_ind.nro_oc
	forms.oc_cabecera_dtl_dlg_ind.controller.show($win)
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"D7D3053B-10C4-4137-AD51-9B4488C00112"}
 */
function onShow(firstShow, event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	filtrar()
}
